{extend name="admin/public/base"/}
{block name="style"}
<link rel="stylesheet" type="text/css" href="__static__/common/css/bootstrap-editable.css">
{/block}
{block name="body"}
<div class="box box-primary">
	<div class="box-header with-border">
		<h3 class="box-title">{$meta_title}</h3>
		<div class="box-tools pull-right">
			<a class="btn btn-sm btn-primary" href="{:url('/admin/form/add')}">新 增</a>
			<button class="btn btn-sm btn-danger ajax-post confirm" url="{:url('/admin/form/del')}" data-form="ids">删 除</button>
		</div>
	</div>
	<div class="box-body">
		<div class="table-responsive clearfix">
			<table class="table table-hover">
				<thead>
					<tr>
						<th width="30"><input class="checkbox check-all" type="checkbox"></th>
						<th width="60">ID</th>
						<th>名称</th>
						<th>排序</th>
						<th>时间</th>
						<th>操作</th>
					</tr>
				</thead>
				<tbody>
					{notempty name="list"}
					{volist name="list" id="item"}
					<tr>
						<td>
							<input class="ids" type="checkbox" name="ids[]" value="{$item['id']}" />
						</td>
						<td>{$item['id']}</td>
						<td>{$item['name']}</td>
						<td>
							<a data-id="{$item.id}" href="{:url('/admin/form/edit?id='.$item['id'])}">{$item['title']}</a>
						</td>
						<td>
							<span>{$item['create_time']}</span>
						</td>
						<td>
							{if $item['status']}
							<span class="label label-primary">{$item['status_text']}</span>
							{else/}
							<span class="label label-danger">{$item['status_text']}</span>
							{/if}
						</td>
						<td>
							<a href="{:url('/admin/form/attr', ['form_id' => $item['id']])}">字段</a>
							<a href="{:url('/admin/form/status', ['form_id' => $item['id'], 'status' => abs(1-$item['status'])])}" class="ajax-get">{$item['status'] ? '禁用' : '启用'}</a>
							<a href="{:url('/admin/form/edit', ['id'=>$item['id']])}">编辑</a>
							<a href="{:url('/admin/form/del', ['id'=>$item['id']])}" class="confirm ajax-get">删除</a>
							<a href="{:url('/admin/form/lists', ['form_id'=>$item['id']])}">数据</a>
							<a href="{:url('front/form', ['id'=>$item['id'], 'name'=>$item['name']])}" target="_blank">浏览</a>
						</td>
					</tr>
					{/volist}
					{else/}
					<td colspan="7" class="text-center">aOh! 暂时还没有创建模型!</td>
					{/notempty}
				</tbody>
			</table>
			{$page|raw}
		</div>
	</div>
</div>
{/block}